package com.itmayiedu.controller;

import com.itmayiedu.service.impl.StudentServiceImpl;
import com.itmayiedu.service.impl.TeacherServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.sql.Timestamp;

/**
 * Created by Devin on 2018/1/27.
 */
@RestController
public class DataSourceController {

    @Autowired
    private StudentServiceImpl studentService;
    @Autowired
    private TeacherServiceImpl teacherService;


    @RequestMapping("/datasource/add")
    public String add(){
        Timestamp timestamp = new Timestamp(System.currentTimeMillis());
        studentService.add("王华","女",timestamp);
        teacherService.add("李强","男",timestamp);
        return "add success";

    }
    @RequestMapping("/datasource/transaction")
    public String transaction(){
        Timestamp timestamp = new Timestamp(System.currentTimeMillis());
        teacherService.add("王华","女",timestamp);
        return "add success";

    }
}
